// 验证中文姓名
export const REGULAR_CHINESE_NAME_STRING =
  '^[\\u4e00-\\u9fa5]{2,20}$|^[\\u4e00-\\u9fa5]{2,20}(?:·[\\u4e00-\\u9fa5]{1,20})+$';
export const REGULAR_CHINESE_NAME = new RegExp(REGULAR_CHINESE_NAME_STRING);
// 验证英文姓名
export const REGULAR_ENGLISH_NAME_STRING = '^[A-Za-z]{2,20}$|^[A-Za-z]{2,20}(?:·[A-Za-z]{1,20})+$';
export const REGULAR_ENGLISH_NAME = new RegExp(REGULAR_ENGLISH_NAME_STRING);
// 验证姓名
export const REGULAR_NAME_STRING = `${REGULAR_CHINESE_NAME_STRING}|${REGULAR_ENGLISH_NAME_STRING}`;
export const REGULAR_NAME = new RegExp(REGULAR_NAME_STRING);
// 验证单位名称
export const REGULAR_UNIT_NAME_STRING = '^[a-zA-Z\\u4e00-\\u9fa5\\(\\)\\（\\）]+$';
export const REGULAR_UNIT_NAME = new RegExp(REGULAR_UNIT_NAME_STRING);
// 验证单位名称或个人
export const REGULAR_PERSONAL_UNIT_NAME_STRING = `${REGULAR_CHINESE_NAME_STRING}|${REGULAR_ENGLISH_NAME_STRING}|${REGULAR_UNIT_NAME_STRING}`;
export const REGULAR_PERSONAL_UNIT_NAME = new RegExp(REGULAR_PERSONAL_UNIT_NAME_STRING);
// 验证统一社会信用代码
export const REGULAR_UNIFIED_SOCIAL_CREDIT_CODE_STRING = '^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$';
export const REGULAR_UNIFIED_SOCIAL_CREDIT_CODE = new RegExp(REGULAR_UNIFIED_SOCIAL_CREDIT_CODE_STRING);
// 验证工商注册代码
export const REGULAR_BUSINESS_REGISTRATION_CODE_STRING = '^[1-9]\\d{14}$';
export const REGULAR_BUSINESS_REGISTRATION_CODE = new RegExp(REGULAR_BUSINESS_REGISTRATION_CODE_STRING);
// 验证统一社会信用代码和工商注册代码
export const REGULAR_UNIT_CODE_STRING = '^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$|^[1-9]\\d{14}$';
export const REGULAR_UNIT_CODE = new RegExp(REGULAR_UNIT_CODE_STRING);
// 军官证
export const REGULAR_OFFICERS_STRING = '^[\\u4e00-\\u9fa5](字第)([0-9a-zA-Z]{4,8})(号?)$';
export const REGULAR_OFFICERS = new RegExp(REGULAR_OFFICERS_STRING);
// 验证手机号码
export const REGULAR_MOBILE_PHONE_STRING = '^1\\d{10}$';
export const REGULAR_MOBILE_PHONE = new RegExp(REGULAR_MOBILE_PHONE_STRING);
// 验证座机号码
export const REGULAR_TELEPHONE_STRING = '^[0][1-9]{2,3}-?[0-9]{5,10}$';
export const REGULAR_TELEPHONE = new RegExp(REGULAR_TELEPHONE_STRING);
// 验证联系号码
export const REGULAR_CONTACT_PHONE_STRING = '^1\\d{10}$|^[0][1-9]{2,3}-?[0-9]{5,10}$';
export const REGULAR_CONTACT_PHONE = new RegExp(REGULAR_CONTACT_PHONE_STRING);
// 验证身份证号码
export const REGULAR_ID_CARD_STRING =
  '^(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)$';
export const REGULAR_ID_CARD = new RegExp(REGULAR_ID_CARD_STRING);
// 验证中文字符
export const REGULAR_CHINESE_CHARACTER_STRING = '^[\\u4e00-\\u9fa5]*$';
export const REGULAR_CHINESE_CHARACTER = new RegExp(REGULAR_CHINESE_CHARACTER_STRING);
// 验证双字节字符(包括汉字在内)
export const REGULAR_DOUBLE_BYTE_CHARACTER_STRING = '^[^\\x00-\\xff]*$';
export const REGULAR_DOUBLE_BYTE_CHARACTER = new RegExp(REGULAR_DOUBLE_BYTE_CHARACTER_STRING);
// 验证Email地址
export const REGULAR_EMAIL_STRING =
  "^[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?$";
export const REGULAR_EMAIL = new RegExp(REGULAR_EMAIL_STRING);
// 验证网址URL
export const REGULAR_URL_STRING = '^[a-zA-z]+:\\/\\/[^\\s]*$';
export const REGULAR_URL = new RegExp(REGULAR_URL_STRING);
// 验证腾讯QQ号
export const REGULAR_QQ_STRING = '^[1-9][0-9]{4,}$';
export const REGULAR_QQ = new RegExp(REGULAR_QQ_STRING);
// 验证中国邮政编码
export const REGULAR_POSTAL_CODE_STRING = '^[1-9]\\d{5}(?!\\d)$';
export const REGULAR_POSTAL_CODE = new RegExp(REGULAR_POSTAL_CODE_STRING);
// 验证(年-月-日)格式日期
export const REGULAR_DATE_10_STRING =
  '(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)';
export const REGULAR_DATE_10 = new RegExp(REGULAR_DATE_10_STRING);
// 验证正整数
export const REGULAR_POSITIVE_INTEGER_STRING = '^\\+?\\d*$';
export const REGULAR_POSITIVE_INTEGER = new RegExp(REGULAR_POSITIVE_INTEGER_STRING);
// 验证负整数
export const REGULAR_NEGATIVE_INTEGER_STRING = '^-\\d*$';
export const REGULAR_NEGATIVE_INTEGER = new RegExp(REGULAR_NEGATIVE_INTEGER_STRING);
// 验证整数
export const REGULAR_INTEGER_STRING = '(^-?|^\\+?)\\d+$';
export const REGULAR_INTEGER = new RegExp(REGULAR_INTEGER_STRING);
// 验证非负整数（正整数 + 0）
export const REGULAR_POSITIVE_INTEGER_AND0_STRING = '^\\+?\\d+$';
export const REGULAR_POSITIVE_INTEGER_AND0 = new RegExp(REGULAR_POSITIVE_INTEGER_AND0_STRING);
// 验证非正整数（负整数 + 0）
export const REGULAR_NEGATIVE_INTEGER_AND0_STRING = '^-\\d+$';
export const REGULAR_NEGATIVE_INTEGER_AND0 = new RegExp(REGULAR_NEGATIVE_INTEGER_AND0_STRING);
// 验证正浮点数
export const REGULAR_POSITIVE_FLOAT_STRING = '^\\+?\\d+\\.\\d+$';
export const REGULAR_POSITIVE_FLOAT = new RegExp(REGULAR_POSITIVE_FLOAT_STRING);
// 验证负浮点数
export const REGULAR_NEGATIVE_FLOAT_STRING = '^-\\d+\\.\\d+$';
export const REGULAR_NEGATIVE_FLOAT = new RegExp(REGULAR_NEGATIVE_FLOAT_STRING);
// 验证浮点数
export const REGULAR_FLOAT_STRING = '^(-?|\\+?)\\d+\\.\\d+$';
export const REGULAR_FLOAT = new RegExp(REGULAR_FLOAT_STRING);
// 验证数
export const REGULAR_NUMBER_STRING = '^((-?|\\+?)\\d+)(\\.\\d+)?$';
export const REGULAR_NUMBER = new RegExp(REGULAR_NUMBER_STRING);
// 验证地址
export const REGULAR_ADDRESS_STRING = '^[\\u4e00-\\u9fa5\\-\\(\\)\\（\\）\\、\\— \\——\\[\\]\\/#a-zA-Z0-9]+$';
export const REGULAR_ADDRESS = new RegExp(REGULAR_ADDRESS_STRING);
// 验证密码
export const REGULAR_PASSWORD_STRING = '^.{6,20}$';
export const REGULAR_PASSWORD = new RegExp(REGULAR_PASSWORD_STRING);
// 严格验证密码
export const REGULAR_PASSWORD_STRICT_STRING = '^(?![0-9]+$)(?![a-zA-Z]+$)(?![\\W_]+$)[0-9a-zA-Z\\W_]{8,32}$';
export const REGULAR_PASSWORD_STRICT = new RegExp(REGULAR_PASSWORD_STRICT_STRING);
// 验证车牌号码
export const REGULAR_PLATE_NUMBER_STRING =
  '^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$';
export const REGULAR_PLATE_NUMBER = new RegExp(REGULAR_PLATE_NUMBER_STRING);
